<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter" %>
<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %>
<%@ page import="org.acegisecurity.AuthenticationException" %>

<html>
  <head>
    <meta name="decorator" content="general">
    <title><fmt:message key="login.login"/></title>
  </head>

  <body>
    <h1><fmt:message key="login.login"/></h1>
	
    <%-- this form-login-page form is also used as the 
         form-error-page to ask for a login again.
         --%>
    <c:if test="${not empty param.login_error}">
      <font color="red">
        <fmt:message key="login.loginFailed" /><BR><BR>
        <fmt:message key="login.reason"><fmt:param><%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %></fmt:param></fmt:message>  
      </font>
    </c:if>

    <form action="<c:url value='j_acegi_security_check'/>" method="POST">
      <table>
        <tr><td align="right"><fmt:message key="login.username"/></td><td><input type='text' name='j_username' <c:if test="${not empty param.login_error}">value='<%= session.getAttribute(AuthenticationProcessingFilter.ACEGI_SECURITY_LAST_USERNAME_KEY) %>'</c:if>></td></tr>
        <tr><td align="right"><fmt:message key="login.username"/></td><td><input type='password' name='j_password'></td></tr>
        <tr><td align="right"><input type="checkbox" name="_acegi_security_remember_me"></td><td><fmt:message key="login.rememberPassword"/></td></tr>

        <tr><td>&nbsp;</td><td><input name="submit" type="submit" value="<fmt:message key="login.login"/>"></td></tr>
      </table>

    </form>

  </body>
</html>
